﻿using System;
using System.Configuration;

namespace CreativeMinds.DNSAPI.Core.Configuration {

	public class FactoryConfigurationSection : ConfigurationSection {
		private static FactoryConfigurationSection settings = ConfigurationManager.GetSection("FactorySettings") as FactoryConfigurationSection;

		private static class Keys {
			public const String APIType = "APIType";
			public const String ConfigurationSection = "ConfigurationSection";
		}

		private FactoryConfigurationSection() { }

		public static FactoryConfigurationSection Settings {
			get {
				return settings;
			}
		}

		[ConfigurationProperty(Keys.APIType, IsRequired = true)]
		public String APIType {
			get { return (String)this[Keys.APIType]; }
			set { this[Keys.APIType] = value; }
		}

		[ConfigurationProperty(Keys.ConfigurationSection, IsRequired = false)]
		public String ConfigurationSection {
			get { return (String)this[Keys.ConfigurationSection]; }
			set { this[Keys.ConfigurationSection] = value; }
		}
	}
}